<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<div id="filter">
    <s:form action="list" cssClass="tableFilter">
        <tr>
        <th colspan="4" class="tableTitle">
            <h5>Equipment</h5>
        </th>
        </tr>

                <s:select label="Site" name="centro.id" id="site"
                          headerKey="" headerValue="Choose a Site"
                          list="centroList"
                          listKey="id"
                          listValue="institucion"
                          >
                </s:select>

                <s:select label="Equipment Type"  id="typeCell1"     name="equipmentType.id"
                          headerKey="" headerValue="Choose a Type"
                          list="equipmentTypes"
                          listKey="id"
                          listValue="description">
                </s:select>


        <tr>
            <td colspan="4" class="centeredButtons"><s:submit value="Search" name="filter" theme="simple" />
                <s:submit action="create" value="New" theme="simple" onclick="resetForms();"/></td>

        </tr>
    </s:form>

</div>

<s:if test="!equipmentcertificationList.isEmpty()"  >

    <div id="table_content">
        <table class="paginated-table">
            <thead>
            <tr>
                <th>Site</th>
                <th>Type</th>
                <th>Serial Number</th>
                <th>Location</th>
                <th></th>
            </tr>
            </thead>
            <tbody>
            <s:iterator value="equipmentcertificationList" >
            <tr>
                <th><s:if test="centro != null"><s:property value="centro.institucion"/></s:if> </th>
                <th><s:if test="equipmentType != null"><s:property value="equipmentType.description"/></s:if></th>
                <th><s:property value="serialNumber"/></th>
                <th><s:property value="location"/></th>
                <th>
                    <s:form action="create" method="POST">
                    <s:hidden value="%{id}" name="editableId" />
                    <a onclick="$(this).closest('form').submit()"><img src="<s:url value="/images/edit.png"/>" title="Edit" alt="Edit"></a></TH>
                    </s:form>
                </th>
            </tr>
            </s:iterator>

            <tbody>
        </table>
        <div style="width: 100%;text-align: center" >
            <span class="prev" style="" >Previous</span><span class="next">Next</span>
        </div>

        <script type="text/javascript">
            paginar(10);
        </script>
    </div>
</s:if>

<script type="text/javascript">
    var list = true;
    $('#equipment').css({"color":"#EE5102","fontWeight":"bold"});
</script>